#include "WebsocketClientExample.h"
#include "WebsocketServerExample.h"

int main()
{
    mg_mgr mgr;
    mg_mgr_init(&mgr);
    WebsocketClientExample client(&mgr);
    WebsocketServerExample server(&mgr);

    server.startWsServer(6100);
    server.run();

    client.connect("ws://localhost:6100/api/test");

    int64_t count = 0;
    while(true)
    {
        // client.run();
        server.run();
        count++;
        if (count % 2000 == 0)
        {
            client.sendMsg("I am websocket client");
        }
    }

    return 0;
}
